package com.tiancheng.trade.settlement.mapper.order;

import com.tiancheng.trade.settlement.bo.ServiceAmountCountBO;
import com.tiancheng.trade.settlement.bo.ServiceDetailCountExportBO;
import com.tiancheng.trade.settlement.bo.ServiceDetailCountRequestBO;
import com.tiancheng.trade.settlement.bo.ServiceDetailCountResBO;
import com.tiancheng.trade.settlement.mapper.TYBaseMapper;
import com.tiancheng.trade.settlement.model.order.SubOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * 子订单持久化接口
 *
 * @author likailun
 * @date 2021-03-31
 */
@Repository
public interface SubOrderMapper extends TYBaseMapper<SubOrder> {
    /**
     * 订单数据统计汇总查询
     *
     * @param year
     * @param month
     * @return
     */
    List<ServiceAmountCountBO> serviceAmountCount(@Param("year") Integer year, @Param("month") String month);

    /**
     * 订单数据明细统计查询
     *
     * @param requestBO     {@link ServiceDetailCountRequestBO}
     * @param merchantCodes {@link List<String>}
     * @return {@link List<ServiceDetailCountResBO>}
     */
    List<ServiceDetailCountResBO> serviceDetailCount(@Param("requestBO") ServiceDetailCountRequestBO requestBO, @Param("merchantCodes") Collection<String> merchantCodes);

    Long serviceDetailCountCount(@Param("requestBO") ServiceDetailCountRequestBO requestBO, @Param("merchantCodes") Collection<String> merchantCodes);

    List<ServiceDetailCountResBO> serviceDetailCountExport(@Param("requestBO") ServiceDetailCountExportBO exportBO, @Param("merchantCodes") Set<String> merchantCodes);
}
